﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fashion_API;

namespace Fashion.Control
{
    public partial class UsrHeader : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            using (DALDataContext d = new DALDataContext() )
            {
                rpMenuHeader.DataSource = d.MenuHeaders.Where(i=>i.IsActive).OrderBy(i=>i.OrderDisplay);
                rpMenuHeader.DataBind();
            }
        }

        protected string GetActive(object url)
        {
            if (Request.Url.AbsolutePath.Equals(url.ToString()))
                return "active";
            return string.Empty;
        }
    }
}